<?php
namespace Home\Controller;
use Think\Controller;
class DigitalController extends Controller{
    public function Digital(){
        //分类页
        $words= I('get.words');  //获取查询的分类的ID
        $Digital = M('pro');

        $cate = M("cate");
        $res = $cate->select();


        $cateD = $cate->where("id = '$words'")->select();





        if (!empty($words)) {
            $data = $Digital->where("cId = '$words'")->select();
        } else {
            $data = $Digital->select();
        }


        $this->assign("cateD", $cateD[0]['cname']);             //传输单条分类名称
        $this->assign( "food", $res );
        $this->assign('select',$data);
        $this->display();
    }
}
?>